package com.example.ui_test.ui

import android.content.Intent
import androidx.core.app.ActivityOptionsCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.example.ui_test.R
import com.kun.base.ui.AbsBaseActivity
import kotlinx.android.synthetic.main.activity_transtion_animal.*

/**
 *测试转场动画的页面
 *
 * @author : Kun
 * @date : 2021/7/2
 * @time : 13:48
 */
@Route(path = "/uiTest/TransitionAnimalActivity")
class TransitionAnimalActivity : AbsBaseActivity() {
    override fun getLayoutId(): Int {
        return R.layout.activity_transtion_animal
    }

    override fun initViewModel() {
    }

    override fun initView() {
        iv_start.setOnClickListener {
            val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, iv_start, "myAnimal")

            val intent = Intent(this, DetailsActivity::class.java)
            startActivity(
                intent,
                options.toBundle()
            )

//            ARouter.getInstance().build("/uiTest/UIMainActivity").withOptionsCompat(options)
        }
    }
}